<%@page import="java.net.URLEncoder"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@page import="com.iwords.service.object.SysLibWordsEntity"%>
<%@page import="java.util.*"%>
<%
    String spelling = ((SysLibWordsEntity) request.getAttribute("currentWord")).getSpelling();
    if (spelling != null) {
        spelling = URLEncoder.encode(spelling, "UTF-8");
    }
%>
<input type="hidden" name="familiarity" id="familiarity" value=${familiarity} >
<input type="hidden" name="libid" id="libid" value=${libid} >
<input type="hidden" name="wordid" id="wordid" value=${currentWord.wordid} >
<input type="hidden" name="spelling" id="spelling" value=${currentWord.spelling} >
<div class="words-panels ks-clear">

    <div class="words-detail">
        <div class="word-title">

            <p class="word-self">
                <strong class="spell">${currentWord.spelling}</strong> 
                <span class="phonogram">${currentWord.phonetics}</span> 
                <a class="pronounce" href="#" title="circle"  onclick=startwav("<%=spelling%>")><img src="images/pronounce.png" /> </a>
            </p>
        </div>
        <div class="word-explain" style="display:none;">
            <div class="cat-bar">
                <span class="bar-title"><strong>基本释义</strong> </span>
            </div>
            <div class="basic-meaning">
                <p>${currentWord.meaning}</p>
            </div>
            <div class="cat-bar">
                <span class="bar-title"><strong>例&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;句</strong>
                </span>
            </div>
            <div class="model-sentence">
                <%
                    List<String> sens = ((SysLibWordsEntity) request.getAttribute("currentWord")).getSens();
                    if (sens != null) {
                        for (int i = 0; i < sens.size(); i++) {

                            String s[] = sens.get(i).split("#");
                            if (s.length == 2) {
                %>
                <p class="model-en">
                    <%
                        out.print((i + 1) + ". " + s[0]);
                    %>

                    <a class="voice" href="#" onclick=liju("<%=URLEncoder.encode(s[0].replaceAll("<span class=\"b\">", "").replaceAll("</span>", ""), "utf-8")%>")><img src="images/voice.png" /></a>
                </p>

                <p class="model-ch">
                    <%
                        out.print(s[1]);
                    %>
                </p>
                <%
                            }
                        }
                    }
                %>
            </div>

            <div class="cat-bar">

                <span class="bar-title"><strong>词&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;性</strong>
                </span>

            </div>
            <div class="model-sentence">
                <p class="model-ch">
                    ${currentWord.partSpeechs}

                </p>

            </div>

        </div>									
    </div>
</div>
